package com.Policing.Polling;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.Policing.R;

import java.util.List;

/**
 * Created by Administrator on 2019/5/5.
 */

public class Site_Adapter_item extends ArrayAdapter {
    public Site_Adapter_item(Context context, int resource, List<Site_Bean> objects) {

        super(context, resource, objects);
    }
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        final Site_Bean linkeMain = (Site_Bean)getItem(position);
        final View view = LayoutInflater.from(getContext()).inflate(R.layout.site_item, null);
        TextView Checking_point = (TextView) view.findViewById(R.id.Checking_point);
        ImageView Asset_img = (ImageView)view.findViewById(R.id.Asset_img);
        TextView status = (TextView) view.findViewById(R.id.status);
        TextView place_date = (TextView)view.findViewById(R.id.place_date);
        TextView id  = (TextView) view.findViewById(R.id.id);
        TextView leave_date = (TextView)view.findViewById(R.id.leave_date);
        TextView point_id = (TextView)view.findViewById(R.id.point_id);
        Asset_img.setImageBitmap(linkeMain.getAsset_img());
        status.setText(linkeMain.getStatus());
        place_date.setText(linkeMain.getPlace_date());
        leave_date.setText(linkeMain.getLeave_date());
        point_id.setText(linkeMain.getPoint_id());
        Checking_point.setText(linkeMain.getChecking_point());
        id.setText(linkeMain.getId());
        return view;
    }


}
